<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
	echo $this->headLink()->appendStylesheet($this->base."../css/user.css");
?>

</head>
<body>
<div class="info">
	<form action="" method="post" id="filteruser">
		<table align="center">
			<tr>
				<td><span class="ctexttd">Username : </span></td>
				<td><input type="text" name="tbxuser" class="cinput" /></td>
				<td><span class="ctexttd">Email : </span></td>
				<td><input type="text" name="tbxemail" class="cinput" /></td>
			</tr>
			<tr>
				<td><span class="ctexttd">Groups : </span></td>
				<td><select class="cinput" name="cbxgroups"><option value="">---</option>
				<?php 
					foreach($this->role as $item){
						echo "<option value='".$item["role_id"]."'>".$item["description"]."</option>";
					}
				?>
				</select></td>
				<td><span class="ctexttd">Action : </span></td>
				<td><select class="cinput" name="cbxaction"><option value="" >---</option><option value="0" >Deactive</option><option value="1" >Active</option></select></td>
			</tr>
			<tr>
				<td class="noneunderline"></td><td class="noneunderline"><input type="submit" name="btnsubmit" value="Filter" class="cfilter" /></td><td class="noneunderline"></td><td class="noneunderline"></td>
			</tr>
		</table>
	</form>
<div class="cadd">
	<a href="/Apprentice_CMS/public/admin/user/add/">Add user</a>
</div>
</div>

<hr />
<div class="list">
	<table align="center">
		
		<?php 
			if($this->data!=null){
				echo "<tr>";
				echo "<td class='cnametd'>Username</td>";
				echo "<td class='cemailtd'>Email</td>";
				echo "<td class='cidtd'>ID</td>";
				echo "</tr>";
				foreach($this->data as $item){
					echo "<tr>";
					echo "<td class='cnametd'>".$item["user_name"]."<br />";
/*<<<<<<< .mine
					echo "<a href='edit/id/".$item['user_id']."'>edit  </a>";
					echo "<a href='permission/id/".$item['user_id']."/role/".$item['role_id']."'>| permission  </a>";
=======*/
					echo "<a href='/Apprentice_CMS/public/admin/user/edit/id/".$item['user_id']."'>edit  </a>";
					echo "<a href='/Apprentice_CMS/public/admin/user/permission/id/".$item['user_id']."/role/".$item['role_id']."'>| role  </a>";
//>>>>>>> .r81
					if($item['user_name']!="admin"){
						if($item["is_active"]==0)
							echo "<a href='/Apprentice_CMS/public/admin/user/active/id/".$item['user_id']."'>| active  </a>";
						else 
							echo "<a href='/Apprentice_CMS/public/admin/user/deactive/id/".$item['user_id']."'>| deactive  </a>";
					}
					echo "</td>";
					echo "<td>".$item["email"]."</td>";
					echo "<td>".$item["user_id"]."</td>";
					echo "</tr>";
				}
			}else{
				echo "ko có user nào hết ";
			}
		?>
	</table>
</div>
</body>
</html>